package com.junglone.gateway.admin.dao;

import java.util.List;

import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;

/**
 * Description: MongoDB 数据操作接口
 *
 * @author junglone: <a href="mailto:cjlnzb@hotmail.com">cjlnzb@hotmail.com</a>
 * @since 2021/03/23 18:09
 */

public interface MongoDao<T> {

	T insert(T object);

	void save(T object);

	T findOne(Query query, Class<T> entityClass);

	long count(Query query, Class<T> entityClass);

	List<T> findAll(Query query, Class<T> entityClass);

	UpdateResult update(Query query, Update update, Class<T> entityClass);

	void createCollection(String collectionName);

	DeleteResult remove(Query query, Class<T> entityClass);

}
